# Contributor: Lauren N. Liberda <lauren@selfisekai.rocks>
# Maintainer: Lauren N. Liberda <lauren@selfisekai.rocks>
pkgname=octoprint-filecheck
pkgver=2021.2.23
pkgrel=0
pkgdesc="Checks for common issues in uploaded files"
url="https://github.com/OctoPrint/OctoPrint-FileCheck"
arch="noarch"
license="AGPL-3.0-only"
depends="octoprint"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
options="!check" # no tests
subpackages="$pkgname-pyc"
source="https://github.com/OctoPrint/OctoPrint-FileCheck/archive/refs/tags/$pkgver/OctoPrint-FileCheck-$pkgver.tar.gz"
builddir="$srcdir/OctoPrint-FileCheck-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages testenv
	testenv/bin/python3 -m installer .dist/*.whl
	testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e572dbd091dbf5ded6bd8d924969d4c5de19afeaf6a9bb1e678a0531e5602e15ca69bf76f1d348a4fc51730355ba8dcb4282d59c2671e0852ed01954110fe804  OctoPrint-FileCheck-2021.2.23.tar.gz
"
